Add a test that dumps settings
authorMatthias Clasen <mclasen@redhat.com>
Sat, 5 Mar 2016 18:41:47 +0000 (13:41 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 5 Mar 2016 18:41:47 +0000 (13:41 -0500)
This is not much of a test, tbh. But it will give us a convenient
dump of all GTK+ settings in continuous, which helps with tracking
down test failures that might depend on settings.

testsuite/tools/Makefile.am
testsuite/tools/test-settings.in [new file with mode: 0755]

index 37f7a41aa921eb67057bc69537d4edd1f7440f0b..5bc7314f0ae2a6b8ce7bce2564b6753345ec8c4b 100644 (file)
@@ -16,24 +16,31 @@ test_simplify = \
 EXTRA_DIST += \
        $(test_simplify)        \
        test-simplify.in        \
+       test-settings.in        \
        $(NULL)
 
 TESTS_ENVIRONMENT = \
-       GTK_BUILDER_TOOL="$(top_builddir)/gtk/gtk-builder-tool"
+       GTK_BUILDER_TOOL="$(top_builddir)/gtk/gtk-builder-tool" \
+       GTK_QUERY_SETTINGS="$(top_builddir)/gtk/gtk-query-settings" \
+       $(NULL)
 
 TEST_PROGS += \
        test-simplify   \
+       test-settings   \
        $(NULL)
 
 test-simplify:test-simplify.in
        $(AM_V_GEN) cp $< $@
 
+test-settings:test-settings.in
+       $(AM_V_GEN) cp $< $@
+
 if BUILDOPT_INSTALL_TESTS
 insttestdir = $(libexecdir)/installed-tests/$(PACKAGE)
 insttest_SCRIPTS = $(TEST_PROGS)
 nobase_insttest_DATA = $(test_simplify)
 
-test-simplify.test: test-simplify Makefile
+%.test: % Makefile
        $(AM_V_GEN) (echo '[Test]' > $@.tmp; \
        echo 'Type=session' >> $@.tmp; \
        echo 'Output=TAP' >> $@.tmp; \
@@ -43,7 +50,7 @@ test-simplify.test: test-simplify Makefile
 test_files = $(TEST_PROGS:=.test)
 
 DISTCLEANFILES = \
-       test-simplify           \
+       $(TEST_PROGS)           \
        $(test_files)           \
        $(NULL)
 
diff --git a/testsuite/tools/test-settings.in b/testsuite/tools/test-settings.in
new file mode 100755 (executable)
index 0000000..a19b472
--- /dev/null
@@ -0,0 +1,17 @@
+#! /bin/bash
+
+GTK_QUERY_SETTINGS=${GTK_QUERY_SETTINGS:-gtk-query-settings}
+TEST_RESULT_DIR=${TEST_RESULT_DIR:-/tmp}
+
+shopt -s nullglob
+
+echo "1..1"
+
+name=gtk-query-settings
+result=$TEST_RESULT_DIR/$name.out
+$GTK_QUERY_SETTINGS 2>/dev/null >$result
+if [ $(wc -l $result | cut -f1 -d' ') -eq 82 ]; then
+  echo "ok 1 $name"
+else
+  echo "not ok 1 $name"
+fi